//
//  NSString+Size.m
//  QSF_Dev
//
//  Created by Mr.Dynasty on 2018/7/12.
//  Copyright © 2018年 Mr.Dynasty. All rights reserved.
//

#import "NSString+Size.h"

@implementation NSString (Size)

+ (CGSize)textString:(NSString *)text fontSize:(CGFloat)fontSize maxWidth:(CGFloat)maxWidth{
    CGRect rect = [text boundingRectWithSize:CGSizeMake(maxWidth, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:fontSize]} context:nil];//计算text的大小
    return rect.size;
}

@end
